<?php
namespace app\admin\controller;
use think\Controller;
use app\admin\pojo\User;
use think\Request;
/**
 * 
 * @author 时
 * 参数测试
 *
 */
class Param extends Controller{
    protected $user;
    protected $name;
    protected $sj;
    protected $request;
    public function __construct($name=null,$age,Request $request,User $user){
        $this->name=$name;
        $this->user=new User($name,$age);
        
    }
    public function index(){
        return $this->name;
    }
    public function index2(){
        return $this->user->getName()."age=".$this->user->getAge();
        
    }
    public function index3(){
        $user=request()->user;
        var_dump($user);
       
    }
}